package com.ternnetwork.batch.mapper.demo;

import org.springframework.batch.item.excel.RowMapper;

import org.springframework.batch.item.excel.support.rowset.RowSet;
import com.ternnetwork.batch.model.demo.CreditBill;

public class ExcelRowToCreditBillMapper  implements RowMapper<CreditBill> {
 
    
    public CreditBill mapRow(RowSet rowSet) throws Exception {
    	if(rowSet.getCurrentRow()==null){
    		return null;
    	}
    	CreditBill t = new CreditBill();
    	t.setAccountId(rowSet.getColumnValue(0));
        t.setAddress(rowSet.getColumnValue(1));
        t.setAmount(Double.parseDouble(rowSet.getColumnValue(2)));
        t.setName(rowSet.getColumnValue(3));
        t.setMobilePhoneNo(rowSet.getColumnValue(4));
       
        return t;
    }

	

}
